package com.example.spring.mono.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotBlank;

@Data
@Document(collection = "order")
public class Order {
    @Id
    private String orderNo;
    @NotBlank(message = "商品名称")
    private String goodsName;
    @Range(min = 10, max = 1000, message = "订单价格需在10-100之间")
    private Double  amout;
    @NotBlank(message = "购买用户")
    private String userId;
}
